#################################################################
##
## FILE:	Makefile
## PROJECT:	CS 3251 Project 2 - Professor Traynor
## DESCRIPTION: Compile Project 2
##
#################################################################

CC=gcc

OS := $(shell uname -s)

SUPPLEMENT=GenericConnection.c utility.c GPSFraming.c GPSEncode.c

# Extra LDFLAGS if Solaris
ifeq ($(OS), SunOS)
	LDFLAGS=-lsocket -lnsl
    endif

all: client server #supplement

client: GPSClient.c
	$(CC) $(SUPPLEMENT) GPSClient.c -o gpsClient

server: GPSServer.c
	$(CC) $(SUPPLEMENT) GPSServer.c -g -o gpsServer
#gcc needs -lpthread if using threads in gpsServer

#supplement: GenericConnection.c utility.c
#	$(CC) GenericConnection.c utility.c -g

clean:
	    rm -f gpsClient gpsServer *.o

